<?PHP
  class RoleList extends Editor{
    function __construct($page){
      $this->page = $page;
    }
  
    public function display(){
      $rolelist = new Template();
      $rolelist->load("role_list");

      $actions = ActionList::get("rolelist");

      if(isset($_GET['insert'])){
        $role = new Role();
        $role->name = $_GET['insert'];
        $role->insert();
      }

      if(isset($_GET['delete'])){
        $role = new Role();
        $role->ID = $_GET['delete'];
        $role->delete();
      }

      $table = new Table();
      $id    = new TableColumn("id",$GLOBALS['language']->getString("ID"));
      $id->autoWidth = true;
      $name  = new TableColumn("name",$GLOBALS['language']->getString("NAME"));
      $table->columns->add($id);
      $table->columns->add($name);
      $table->name    = "{'dbprefix'}roles";
      $table->actions = "rolelist";
      $table->orderBy = "name";
      $table->cacheName = "rolelist";

      $rolelist->assign_var("TABLE",$table->getCode());
      $rolelist->output();
    }

    function getHeader(){
    }
    
    public function getEditableCode(){
      return "<input name=\"save\" type=\"submit\" value=\"&Auml;ndern\" onclick=\"form.action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."' ; target='_self' ; return true\" />";
    }
    
    public function save($newPage,$oldPage){
    }    
  }
?>